/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view.jPanels;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Gean
 */
@Entity
@Table(name = "bempatrimonial", catalog = "", schema = "")
@NamedQueries({
    @NamedQuery(name = "Bempatrimonial.findAll", query = "SELECT b FROM Bempatrimonial b"),
    @NamedQuery(name = "Bempatrimonial.findByIdBemPatrimonial", query = "SELECT b FROM Bempatrimonial b WHERE b.bempatrimonialPK.idBemPatrimonial = :idBemPatrimonial"),
    @NamedQuery(name = "Bempatrimonial.findByDescricao", query = "SELECT b FROM Bempatrimonial b WHERE b.descricao = :descricao"),
    @NamedQuery(name = "Bempatrimonial.findByCor", query = "SELECT b FROM Bempatrimonial b WHERE b.cor = :cor"),
    @NamedQuery(name = "Bempatrimonial.findByMarca", query = "SELECT b FROM Bempatrimonial b WHERE b.marca = :marca"),
    @NamedQuery(name = "Bempatrimonial.findByNumeroSerie", query = "SELECT b FROM Bempatrimonial b WHERE b.numeroSerie = :numeroSerie"),
    @NamedQuery(name = "Bempatrimonial.findByPlaquetaNumPlaqueta", query = "SELECT b FROM Bempatrimonial b WHERE b.bempatrimonialPK.plaquetaNumPlaqueta = :plaquetaNumPlaqueta"),
    @NamedQuery(name = "Bempatrimonial.findByResponsavelSIAPE", query = "SELECT b FROM Bempatrimonial b WHERE b.responsavelSIAPE = :responsavelSIAPE"),
    @NamedQuery(name = "Bempatrimonial.findByNotaFiscal", query = "SELECT b FROM Bempatrimonial b WHERE b.notaFiscal = :notaFiscal"),
    @NamedQuery(name = "Bempatrimonial.findByIdPredio", query = "SELECT b FROM Bempatrimonial b WHERE b.idPredio = :idPredio"),
    @NamedQuery(name = "Bempatrimonial.findByIdSala", query = "SELECT b FROM Bempatrimonial b WHERE b.idSala = :idSala")})
public class Bempatrimonial implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected BempatrimonialPK bempatrimonialPK;
    @Basic(optional = false)
    @Column(name = "Descricao")
    private String descricao;
    @Basic(optional = false)
    @Column(name = "Cor")
    private String cor;
    @Basic(optional = false)
    @Column(name = "Marca")
    private String marca;
    @Basic(optional = false)
    @Column(name = "NumeroSerie")
    private String numeroSerie;
    @Basic(optional = false)
    @Column(name = "Responsavel_SIAPE")
    private int responsavelSIAPE;
    @Column(name = "NotaFiscal")
    private String notaFiscal;
    @Basic(optional = false)
    @Column(name = "idPredio")
    private int idPredio;
    @Basic(optional = false)
    @Column(name = "idSala")
    private int idSala;

    public Bempatrimonial() {
    }

    public Bempatrimonial(BempatrimonialPK bempatrimonialPK) {
        this.bempatrimonialPK = bempatrimonialPK;
    }

    public Bempatrimonial(BempatrimonialPK bempatrimonialPK, String descricao, String cor, String marca, String numeroSerie, int responsavelSIAPE, int idPredio, int idSala) {
        this.bempatrimonialPK = bempatrimonialPK;
        this.descricao = descricao;
        this.cor = cor;
        this.marca = marca;
        this.numeroSerie = numeroSerie;
        this.responsavelSIAPE = responsavelSIAPE;
        this.idPredio = idPredio;
        this.idSala = idSala;
    }

    public Bempatrimonial(int idBemPatrimonial, int plaquetaNumPlaqueta) {
        this.bempatrimonialPK = new BempatrimonialPK(idBemPatrimonial, plaquetaNumPlaqueta);
    }

    public BempatrimonialPK getBempatrimonialPK() {
        return bempatrimonialPK;
    }

    public void setBempatrimonialPK(BempatrimonialPK bempatrimonialPK) {
        this.bempatrimonialPK = bempatrimonialPK;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        String oldDescricao = this.descricao;
        this.descricao = descricao;
        changeSupport.firePropertyChange("descricao", oldDescricao, descricao);
    }

    public String getCor() {
        return cor;
    }

    public void setCor(String cor) {
        String oldCor = this.cor;
        this.cor = cor;
        changeSupport.firePropertyChange("cor", oldCor, cor);
    }

    public String getMarca() {
        return marca;
    }

    public void setMarca(String marca) {
        String oldMarca = this.marca;
        this.marca = marca;
        changeSupport.firePropertyChange("marca", oldMarca, marca);
    }

    public String getNumeroSerie() {
        return numeroSerie;
    }

    public void setNumeroSerie(String numeroSerie) {
        String oldNumeroSerie = this.numeroSerie;
        this.numeroSerie = numeroSerie;
        changeSupport.firePropertyChange("numeroSerie", oldNumeroSerie, numeroSerie);
    }

    public int getResponsavelSIAPE() {
        return responsavelSIAPE;
    }

    public void setResponsavelSIAPE(int responsavelSIAPE) {
        int oldResponsavelSIAPE = this.responsavelSIAPE;
        this.responsavelSIAPE = responsavelSIAPE;
        changeSupport.firePropertyChange("responsavelSIAPE", oldResponsavelSIAPE, responsavelSIAPE);
    }

    public String getNotaFiscal() {
        return notaFiscal;
    }

    public void setNotaFiscal(String notaFiscal) {
        String oldNotaFiscal = this.notaFiscal;
        this.notaFiscal = notaFiscal;
        changeSupport.firePropertyChange("notaFiscal", oldNotaFiscal, notaFiscal);
    }

    public int getIdPredio() {
        return idPredio;
    }

    public void setIdPredio(int idPredio) {
        int oldIdPredio = this.idPredio;
        this.idPredio = idPredio;
        changeSupport.firePropertyChange("idPredio", oldIdPredio, idPredio);
    }

    public int getIdSala() {
        return idSala;
    }

    public void setIdSala(int idSala) {
        int oldIdSala = this.idSala;
        this.idSala = idSala;
        changeSupport.firePropertyChange("idSala", oldIdSala, idSala);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (bempatrimonialPK != null ? bempatrimonialPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Bempatrimonial)) {
            return false;
        }
        Bempatrimonial other = (Bempatrimonial) object;
        if ((this.bempatrimonialPK == null && other.bempatrimonialPK != null) || (this.bempatrimonialPK != null && !this.bempatrimonialPK.equals(other.bempatrimonialPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "view.jPanels.Bempatrimonial[ bempatrimonialPK=" + bempatrimonialPK + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
